﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentNHibernate.Mapping;
using YasharEl.Infrastructure.Core.EntityModel.Applications;

namespace YasharEl.Infrastructure.Core.PersistenceModel.NHibernate.Applications.Mappings
{
    public class ApplicationEntityMap : ClassMap<ApplicationEntity>
    {
        public ApplicationEntityMap()
        {
            ReadOnly();
            Cache.ReadOnly();

            Table("Applications");

            Id(e => e.ApplicationId)
                .Column("ApplicationId")
                .GeneratedBy.Assigned();

            Map(e => e.ApplicationName)
                .Column("ApplicationName")
                .Unique()
                .Not.Nullable();

            Map(e => e.Description)
                .Column("Description")
                .Not.Nullable();

        }
    }
}
